package Box2D.Dynamics.Joints
{
	import Box2D.Common.Math.b2Vec2;
	import Box2D.Dynamics.b2Body;
	
	/// Weld joint definition. You need to specify local anchor points
	/// where they are attached and the relative body angle. The position
	/// of the anchor points is important for computing the reaction torque.
	public class b2WeldJointDef extends b2JointDef
	{
		private var _localAnchorA:b2Vec2;
		private var _localAnchorB:b2Vec2;
		public function b2WeldJointDef()
		{
			super(callDirect('b2WeldJointDef_new'));
			_localAnchorA = new b2Vec2(0,0,wrapper+17);
			_localAnchorB = new b2Vec2(0,0,wrapper+25)
		}
		public override function get cls():Class{return b2WeldJoint}
		
		/// The local anchor point relative to body1's origin.
		public function get localAnchorA():b2Vec2{return _localAnchorA}
		public function set localAnchorA(value:b2Vec2):void{_localAnchorA.Copy(value)}
		
		/// The local anchor point relative to body2's origin.
		public function get localAnchorB():b2Vec2{return _localAnchorB}
		public function set localAnchorB(value:b2Vec2):void{_localAnchorB=value}
		
		/// The body2 angle minus body1 angle in the reference state (radians).
		public function get referenceAngle():Number{return getNumber(33)}
		public function set referenceAngle(value:Number):void{setNumber(33,value)}
		
		/// Initialize the bodies, anchors, and reference angle using a world
		/// anchor point.
		public function Initialize(body1:b2Body, body2:b2Body, anchor:b2Vec2):void{
			call('b2WeldJointDef_Initialize',body1.wrapper,body2.wrapper,anchor.wrapper);
		}
	}
}